<template>
    <div class="process-monitoring-box">
        <div class="resource-library-type-table">
            <div class="resource-library-type" style="width: 30%;overflow-x: auto;" v-show="classEelement">
                <div style="padding:5px 0 0 5px;display: flex;justify-content: space-between;">
                    <div>
                        <!-- @click="treeOperation(true)" @click="treeOperation(false)" -->
                        <a-button style="height: 25px !important;" @click="$refs.xTree.setAllTreeExpand(true)" ghost ><a-icon style="font-size: 16px;" type="caret-down" theme="filled" />展开</a-button>
                        <a-button style="margin-left: 5px;height: 25px !important;" @click="$refs.xTree.clearTreeExpand()" ghost><a-icon style="font-size: 16px;" type="caret-up" theme="filled" />收起</a-button>
                    </div>
                    <div>
                        <a-button style="margin-left: 5px;height: 25px !important;" @click="zkClassEelement(false)" ghost><a-icon style="font-size: 16px;" type="caret-up" theme="filled" />隐藏分类</a-button>
                    </div>
                </div>
                <vxe-table
                    class="tree-vxetable-box"
                    resizable
                    ref="xTree"
                    :show-header="false"
                    :tree-config="{transform: true, rowField: 'id', parentField: 'parentId',iconClose:'vxe-icon-square-plus-fill',iconOpen:'vxe-icon-square-minus-fill'}"
                    :radio-config="{labelField: 'name'}"
                    :data="treeTypeList"
                    :row-config="{isCurrent: true, isHover: true}"
                    @current-change="currentChangeEvent"
                    @cell-click="cellClick"
                >
                <!-- @click="$refs.xTree.clearCurrentRow()" -->
                    <vxe-column field="name" title="name" tree-node>
                        <template #default="{ row }">
                            <span>
                                <template v-if="!row.parentId || row.children && row.children.length">
                                    <a-icon style="font-size: 16px;color: #ffa500;" :type="$refs.xTree.isTreeExpandByRow(row) ? 'folder-open' : 'folder'" theme="filled"></a-icon>
                                </template>
                                <template v-else>
                                    <i class="tree-node-icon vxe-icon-file-txt"></i>
                                </template>
                                <span>{{ row.name }}</span>
                            </span>
                        </template>
                    </vxe-column>
                </vxe-table>
                <!-- <a-tree
                    :key="treeKey"
                    v-if="treeTypeList.length>0"
                    :show-line="true"
                    :show-icon="true"
                    :tree-data="treeTypeList"
                    :replaceFields='replaceFields'
                    v-model:selectedKeys="selectedKeys"
                    :default-expand-all="defaultExpandAll"
                    :defaultSelectedKeys="selectedKeys"
                    @select="treeChange"
                >
                    <a-icon slot="parentLevel" type="folder-open" theme="filled" style="font-size: 16px;color: #ffa500;" />
                    
                </a-tree> -->
                <!-- <a-icon slot="childLevel" type="file" theme="filled" style="font-size: 16px;color: #ffa500;" /> -->
                <!-- v-model:selectedKeys="selectedKeys" -->
            </div>
            <div v-show="!classEelement">
                <a-button style="margin-left: 5px;height: 25px !important;" @click="zkClassEelement(true)" ghost><a-icon style="font-size: 16px;" type="caret-up" theme="filled" />展开分类</a-button>
            </div>
            <div class="resource-library-table">
                <commpVxeTable
                :key="vxeTableKey"
                :config="dataTableConfig"
                :columns="columnsVxe"
                :formItem="formItem"
                ref="acceptanceRegistrationRef"
                @searchEvent="searchEvent"
                :conditionBtnRow="true"
                :isCanWrap="true"
                @resetEvent="resetEvent"
                @checkboxChange="checkboxChange"
                
                >
                    <!-- <template v-slot:ftype_time="{data}"  >
                        <a-tree-select
                            v-model:value="ftype"
                            :expandedKeys="expandedKeys"
                            :tree-data="treeTypeList"
                            :replaceFields='replaceFields'
                            style="width: 180px"
                            placeholder="请选择分类"
                            allow-clear
                            tree-default-expand-all
                            @change="treeChange"
                        />
                    </template> -->
                    <template v-slot:externalOperations="{data}">
                        <vxe-form-item>
                            <template>
                                <!-- <a-button class="blue-btn" type="primary" @click="initiate" >发起质量体系文件流程</a-button> -->
                                <a-button class="blue-btn" type="primary" @click="initiate" style="margin-top: 3px;">新增文件</a-button>
                                <a-button class="blue-btn" type="primary" @click="promotePublicize" style="margin-top: 3px;margin-left: 10px;">发起宣贯培训</a-button>
                            </template>
                        </vxe-form-item>
                    </template>

                    <template v-slot:fwjmc_name="{row}">
                        <div class="quality-system-fwjmc">
                            <a @click="viewClick(row)">
                                <span v-if="row.fxdzt" class="fxdzt-name" :class="row.fxdzt=='修订'?'orange-v':(row.fxdzt=='修改'?'yellow-v':(row.fxdzt=='作废'?'red-v':''))">{{ row.fxdzt }}</span>
                                <span>{{ row.fwjmc }}</span>
                            </a>
                        </div>
                    </template>
                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                        <a-form layout="inline" class="search-form" >
                            <a-form-item>
                                <a-button class="blue-btn" type="primary" @click="modifyClick(row)" icon="edit">编辑</a-button>
                            </a-form-item>
                            <!-- <a-form-item >
                                <a-button class="blue-btn" type="primary" @click="amendmentClick(row)">修订</a-button>
                            </a-form-item>
                            <a-form-item >
                                <a-button class="blue-btn" type="primary" @click="loseEfficacyClick(row)">作废</a-button>
                            </a-form-item> -->
                            <a-form-item >
                                <a-button class="green-btn" type="primary" icon="eye" @click="editClick(row)" >查看</a-button>
                            </a-form-item>
                            <a-form-item v-if="row.fwjlx && row.fsfyxxz !== 1">
                                <a-button class="green-l-btn" type="primary" icon="download" @click="downloadClick(row)">下载</a-button>
                            </a-form-item>
                        </a-form>
                    </template>
                </commpVxeTable>
            </div>
        </div>
        <a-modal
            title="编辑"
            :visible="visible"
            @ok="handleOk"
            @cancel="visible = false"
        >
            <div style="display: flex;justify-content: center;" class="xdzf-modal-box">
                <a-radio-group name="radioGroup" v-model:value="operationValue">
                    <a-radio value="修订">修订</a-radio>
                    <a-radio value="作废">作废</a-radio>
                </a-radio-group>
            </div>
        </a-modal>
        <increase ref="increaseRef" @successClick="successClick"/>
        <qualityFlowIncrease ref="refModel" :addEditParameter="addEditParameter" :viewFlag="true" @successReturn="successReturn" @reviseClick="reviseClick"/>
        <serverEditingView ref="serverEditingViewRef" @refreshChange="$event=>{}"/>
    </div>
</template>
<script>
import assessCheckApi from './service/api'
import increase from '../resourceLibrary/increase.vue'
import commpVxeTable from '@/components/commp-vxe-table/commp-vxe-table.vue'
import blobType from '@/common/blobType'
import moment from 'moment'
import qualityFlowIncrease from '../../assessCheck/qualityFlow/increase.vue'
import { deleteBatch, downloadFile,zltxwjClientOfficeApigetZltxwjFile,flowZltxwjxgpxInitZltxwjFlow,
leadingInExccel,
leadingOutExccel,
leadingOutFormwork,
initZltxwjFlow,
addInitZltxwjFlow,
queryTreeList,
queryJobByJobId,
initZltxwjSxFlow,
} from './service/index'
// import serverEditingView from '@/components/comp-model-series/server-editing-view'
import store from '@/store'
import serverEditingView from '../resourceLibrary/viesFile.vue'

function addParentId(nodes, parentId = null) {
  nodes.forEach(node => {
    node.id = node.key
    node.parentId = parentId;
    if (node.children && node.children.length > 0) {
      addParentId(node.children, node.key);
    }
  });
}
export default {
    components:{
        commpVxeTable,
        increase,
        qualityFlowIncrease,
        serverEditingView,
    },
    props:{

    },
    data(){
        return{
            visible:false,
            ftype:undefined,
            replaceFields: {
                children: 'children', //后端数组层级的名字
                key: 'value', //一般是id
                title: 'value',
                value: 'value' //onSelect(selectedKeys)的selectedKeys的参数值，便于获取然后返回给后端
            },
            treeTypeList:[],
            selectedKeys:[],
            expandedKeys:[],
            formItem:[
                {
                    label: '文件名称',
                    model: 'fwjmc',
                },{
                    label: '文件编号',
                    model: 'fwjbh',
                }

            ],//
            columnsVxe:[{
                type: 'checkbox',
                width: 60 ,
                fixed: 'left'
            },{
                title: '文件名称', //列头显示文字
                field: 'fwjmc',
                slots: {
                    default: 'fwjmc_name',
                },
            },{
                title: '分类',
                field: 'ftype',
                width:82,
                titleInterval:true,
                slots: {
                    header:'ftype_header',
                },
                width:105,
            },{
                title: '状态',
                field: 'fzt',
                width:80,
                titleInterval:true,
                slots: {
                    header:'fzt_header',
                },
            },{
                title: '操作',
                field: 'id',
                titleInterval:true,
                slots: {
                // 使用插槽模板渲染
                    default: 'operation_btn',
                    header:'operation_header',
                },
                width:256
                // visible:!this.parameter.isReadOnly
            }],
            columnsVxe1:[
            {
                type: 'checkbox',
                width: 60 ,
                fixed: 'left'
            },{
                title: '序号', //列头显示文字
                field: 'forder',
                width: 50 ,
            },{
                title: '文件名称', //列头显示文字
                field: 'fwjmc',
                slots: {
                    default: 'fwjmc_name',
                },
            },{
                title: '分类',
                field: 'ftype',
                width:82,
                titleInterval:true,
                slots: {
                    header:'ftype_header',
                },
                width:105,
            },{
                title: '文件编号',
                field: 'fwjbh',
                width:109,
            },
            // {
            //     title: '修改次数',
            //     field: 'fxgcs',
            //     width:77,
            // },
            {
                title: '实施日期',
                field: 'fssrq',
                width:100,
            },{
                title: '上传日期',
                field: 'fscrq',
                width:100,
            },{
                title: '状态',
                field: 'fzt',
                width:80,
                titleInterval:true,
                slots: {
                    header:'fzt_header',
                },
            },{
                title: '操作',
                field: 'id',
                titleInterval:true,
                slots: {
                // 使用插槽模板渲染
                    default: 'operation_btn',
                    header:'operation_header',
                },
                width:256
                // visible:!this.parameter.isReadOnly
            }],
            columnsVxe2:[{
                type: 'checkbox',
                width: 60 ,
                fixed: 'left'
            },{
                title: '文件名称', //列头显示文字
                field: 'fwjmc',
                slots: {
                    default: 'fwjmc_name',
                },
            },{
                title: '分类',
                field: 'ftype',
                width:82,
                titleInterval:true,
                slots: {
                    header:'ftype_header',
                },
                width:105,
            },{
                title: '状态',
                field: 'fzt',
                width:80,
                titleInterval:true,
                slots: {
                    header:'fzt_header',
                },
            },{
                title: '操作',
                field: 'id',
                titleInterval:true,
                slots: {
                // 使用插槽模板渲染
                    default: 'operation_btn',
                    header:'operation_header',
                },
                width:256
                // visible:!this.parameter.isReadOnly
            }],
            dataTableConfig:{
                api: assessCheckApi.list,
                rowId: 'id',
                pageSize:20,
                paramet:{
                    fzt:'现行有效'
                }
            },
            selectIdArr:[],
            DownloadTemplateLoading:false,
            leadingOutLoading:false,
            searchFrom:{},
            addEditParameter:{},
            operationValue:'修订',
            operationData:{},
            defaultExpandAll:true,
            treeKey:null,
            vxeTableKey:null,
            currentGlData:{},
            classEelement:true,
            currentTreeD:[],
        }
    },
    watch:{

    },
    mounted(){
        queryTreeList().then(res => {
            if (res.code == 200){
                addParentId(res.result)
                // this.treeTypeList = res.result;
                // this.treeParentClick(res.result)
                res.result.forEach(item=>{
                    this.getTreeItem(item)
                })
                this.currentTreeD = res.result
                //console.log('树的结构',this.treeTypeList)

            }
        })
    },
    methods:{
        getTreeItem(item){
            this.treeTypeList.push({
                id:item.id,
                key:item.key,
                parentId:item.parentId,
                name:item.value,
                children:item.children

            })
            if(item.children && item.children.length>0){
                item.children.forEach(trem=>{
                   this.getTreeItem(trem) 
                })
            }
        },
        currentChangeEvent({row}){
            //console.log('获取高亮行',row)
            
            this.ftype = row.name
            this.dataTableConfig.paramet = {
                ...this.dataTableConfig.paramet,
                ftype:row.name,
                ftypeid:row.id,
            }
            this.successClick()
            this.searchFrom['ftype'] = row.name
        },
        cellClick({row}){
            //console.log('我选中什么1',row.id)
            //console.log('我选中什么2',this.currentGlData.id)
            if(row.id == this.currentGlData.id){
                this.$refs.xTree.clearCurrentRow()
                this.currentGlData = {}
                this.ftype = ''
                this.dataTableConfig.paramet = {
                    ...this.dataTableConfig.paramet,
                    ftype:'',
                    ftypeid:'',
                }
                this.successClick()
                this.searchFrom['ftype'] = ''
            }else{
                this.currentGlData = row
            }
            
        },
        zkClassEelement(val){
            //console.log(val)
            this.classEelement = val
            if(val){
                this.columnsVxe = this.columnsVxe2
            }else{
                this.columnsVxe = this.columnsVxe1
            }
            this.vxeTableKey = Date.now()
        },
        viewClick(val){
            this.$refs.serverEditingViewRef.getData({id:val.id,type:'质量体系文件资源库',fwjlx:'.pdf'})
            this.$refs.serverEditingViewRef.visibleShow = true
        },
        treeOperation(val){
            this.defaultExpandAll = val
            this.treeKey = Date.now()
        },
        treeParentClick(tree){
            if (!tree || tree.length) return;
            tree.forEach((item,index)=>{
                this.treeTypeList.push({...item,slots: {icon: 'smile',},})
            })
        },
        initiate(){
            var that = this
            this.$confirm({
                title:'您确认要发起流程吗？',
                // icon: createVNode(ExclamationCircleOutlined),
                onOk() {
                    addInitZltxwjFlow().then(res=>{
                        if(res.code == 200){
                            // that.$message.success(res.message)
                            that.reviseClick({jobid:res.result.id})

                            // return
                            // that.$router.push('/assessCheck/qualityFlow/abeyance')
                        }else{
                            that.$message.warning(res.message)
                        }
                    })
                },

            });
        },
        promotePublicize(){
            if(this.selectIdArr.length){
                var that = this
                this.$confirm({
                    title:'您确认要发起宣贯培训吗？',
                    // icon: createVNode(ExclamationCircleOutlined),
                    onOk() {
                        flowZltxwjxgpxInitZltxwjFlow({ids:that.selectIdArr.join(',')}).then(res=>{
                            if(res.code == 200){
                                that.$message.success(res.message)
                                // dealWithType
                                that.reviseClick({jobid:res.result.id},'宣贯')

                            }else{
                                that.$message.warning(res.message)
                            }
                        })
                    },

                });
                
            }else{
                this.$message.warning('请先选择发起宣贯培训项')
            }
        },
        modifyClick(row){//编辑
            this.operationData = row
            this.visible = true
        },
        handleOk(){
            if(this.operationValue == '修订'){
                this.amendmentClick(this.operationData)
            }else if(this.operationValue == '作废'){
                this.loseEfficacyClick(this.operationData)
            }
        },
        amendmentClick(val){
            var that = this
            this.$confirm({
                title:'您确认要修订吗？',
                // icon: createVNode(ExclamationCircleOutlined),
                onOk() {
                    initZltxwjFlow({id:val.id}).then(res=>{
                        if(res.code == 200){
                            //console.log(res)
                            that.$message.success(res.message)
                            that.reviseClick({jobid:res.result.id})
                            // return
                            that.visible = false
                            // that.$router.push('/assessCheck/qualityFlow/abeyance')
                        }else{
                            that.$message.warning(res.message)
                        }
                    })
                },

            });
        },
        loseEfficacyClick(val){
            var that = this
            this.$confirm({
                title:'您确认要作废吗？',
                // icon: createVNode(ExclamationCircleOutlined),
                onOk() {
                    initZltxwjSxFlow({id:val.id}).then(res=>{
                        if(res.code == 200){
                            //console.log(res)
                            that.$message.success(res.message)
                            that.visible = false
                            that.reviseClick({jobid:res.result.id})
                            // that.$router.push('/assessCheck/qualityFlow/abeyance')
                        }else{
                            that.$message.warning(res.message)
                        }
                    })
                },

            });
        },
        reviseClick(val,type){
            //console.log(val)
            queryJobByJobId({jobid: val.jobid}).then(res=>{
                if(res.code == 200){
                    let data = res.result.zltxwj
                    this.addEditParameter = {
                        isDisabled:true,
                        jobid: res.result.job.id,
                        fblzt: res.result.job.fblzt,
                        fthyj: res.result.job.fthyj,
                        fhjmc: res.result.job.fhjmc,
                        zltxwjid: data.id,
                        fsqrq: data.fsqrq?moment(data.fsqrq).format('YYYY-MM-DD'):'',
                        fssrq: data.fssrq?moment(data.fssrq).format('YYYY-MM-DD'):'',
                        fscrq: data.fscrq?moment(data.fscrq).format('YYYY-MM-DD'):'',
                        fwjmc: data.fwjmc,
                        ftype: data.ftype,
                        forder: data.forder,
                        fwjbh: data.fwjbh,
                        fxgcs: data.fxgcs,
                        fskbb: data.fskbb,
                        fwjlx: data.fwjlx,
                        fwjlj: data.fwjlj,
                        fzt: data.fzt,
                        fsqr: data.fsqr,
                        fsqks: data.fsqks,
                        fxglx: data.fxglx ? data.fxglx : '修订',
                        fxdly: data.fxdly,
                        fqcsm: data.fqcsm,

                        // nextNodeDbrList: res.result.nextNodeDbrList,
                        nextNode: res.result.nextNode,
                        nextNodeDbr: res.result.nextNodeDbrList[res.result.nextNodeDbrList.length - 1].dbr,
                        ffsr: data.ffsr,
                        ffssj: data.ffssj,
                        fblr: data.fblr,
                        dbrid: [],
                        opinion: '',//办理意见
                        smgflag: '否',//是否发送短信
                        dealWithType:type,
                    }
                    this.$refs.refModel.getData(this.addEditParameter)
                    this.$refs.refModel.visibleShow = true
                    this.$refs.refModel.spinning = true
                    this.$aSpinningKey = true
                }else{
                    this.$message.warning(res.message)
                }
            })
        },
        successReturn(){},
        // reviseClick(){},
        successClick(){
            this.$refs.acceptanceRegistrationRef.searchEvent()
        },
        treeChange(val){
            //console.log(val)
            this.selectedKeys = val
            this.defaultSelectedKeys = val
            this.ftype = val.length?val[0]:''
            this.dataTableConfig.paramet = {
                ...this.dataTableConfig.paramet,
                ftype:val.length?val[0]:''
            }
            this.successClick()
            this.searchFrom['ftype'] = val.length?val[0]:''
        },
        searchEvent(searchFrom){//搜索
            this.dataTableConfig.paramet = {
                ...this.dataTableConfig.paramet,
                ftype:this.ftype?this.ftype:''
            }
            this.searchFrom = {...searchFrom,...this.dataTableConfig.paramet}
            //console.log(this.dataTableConfig.paramet)
        },
        resetEvent(){//重置
            this.dataTableConfig.paramet = {
                ...this.dataTableConfig.paramet,
            }
            this.ftype = undefined
            this.searchFrom = {}
        },

        newlyAddedClick(){
            this.$refs.increaseRef.getData({ftypeid:this.currentTreeD[0].id,fzt:'现行有效',forder:1,funIndex:0},this.currentTreeD)
            this.$refs.increaseRef.visibleShow = true
        },
        checkboxChange(row){
            this.selectIdArr = []
            row.forEach(item => {
                this.selectIdArr.push(item.id)
            });
        },
        batchDelete(){
            var that = this
            if(this.selectIdArr.length){
                this.$confirm({
                    title:'您确认要删除吗？',
                    onOk() {
                        deleteBatch({ids:that.selectIdArr.join(',')}).then(res=>{
                            if(res.code == 200){
                                that.$message.success(res.message)
                                that.$refs.acceptanceRegistrationRef.searchEvent()
                            }else{
                                that.$message.warning(res.message)
                            }
                        })
                    }
                })
            }else{
                this.$message.warning('请选择删除项')
            }
        },
        importClick({file}){
            var that = this
            if(typeof file.uid !== 'undefined') {
                if(file.name.indexOf(".xls") !== -1 || file.name.indexOf(".xlsx") !==-1) {
                    const fileData = new FormData();
                    fileData.append("file",file);
                    leadingInExccel(fileData).then(res => {
                        that.renovateSearchTabel()
                        that.$message.success('导入成功')
                    }).catch(error =>{
                        that.$message.success('导入失败')
                    })
                }else{
                    this.$message.warning('请导入正确的文件类型')
                }

            }
        },
        exportClick(){//导出
            var that = this
            this.leadingOutLoading = true
            var fileName = '质量体系文件模板'
            let param = { }
            if(that.selectIdArr.length){
                param = {
                    ids:that.selectIdArr.join(',')
                }
            }else{
                param = this.searchFrom
            }

            leadingOutExccel(param).then((data) => {
                this.leadingOutLoading = false
                if (!data) {
                    that.$message.warning('文件下载失败')
                    return
                }
                if (typeof window.navigator.msSaveBlob !== 'undefined') {
                    window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
                } else {
                    let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
                    let link = document.createElement('a')
                    link.style.display = 'none'
                    link.href = url
                    link.setAttribute('download', fileName + '.xls')
                    document.body.appendChild(link)
                    link.click()
                    document.body.removeChild(link) //下载完成移除元素
                    window.URL.revokeObjectURL(url) //释放掉blob对象
                }
            })

        },
        downloadTemplate(){
            var that = this
            this.DownloadTemplateLoading = true
            var fileName = '质量体系文件模板'
            let param = {}

            leadingOutFormwork(param).then((data) => {
                this.DownloadTemplateLoading = false
                if (!data) {
                    that.$message.warning('文件下载失败')
                return
                }
                // if (typeof window.navigator.msSaveBlob !== 'undefined') {
                //     window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }))
                // } else {
                    let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
                    let link = document.createElement('a')
                    link.style.display = 'none'
                    link.href = url
                    link.setAttribute('download', fileName + '.xls')
                    document.body.appendChild(link)
                    link.click()
                    document.body.removeChild(link) //下载完成移除元素
                    window.URL.revokeObjectURL(url) //释放掉blob对象
                // }
            })
        },
        editClick(val){
            this.$refs.increaseRef.getData({...val,funIndex:0,disabled:true,title:'查看',views:true},this.currentTreeD)
            this.$refs.increaseRef.visibleShow = true
        },
        deleteClick(val){
            var that = this
            this.$confirm({
                title:'您确认要删除吗？',
                onOk() {
                    deleteBatch({ids:val.id}).then(res=>{
                        if(res.code == 200){
                            that.$message.success(res.message)
                            that.$refs.acceptanceRegistrationRef.searchEvent()
                        }else{
                            that.$message.warning(res.message)
                        }
                    })
                }
            })
        },
        downloadClick(val){
            //console.log(val)
            if(!val.fwjlx){
                this.$message.warning('当前暂无文件')
                return false
            }
            var that = this
            this.downloadFileLoading = true
            var fileName = val.fwjmc+'.pdf'
            //console.log(fileName)
            let param = {id: val.id,symc:store.getters.userInfo.realname+moment().format('YYYY年MM月DD日')}

            zltxwjClientOfficeApigetZltxwjFile(param).then((data) => {
                this.downloadFileLoading = false
                if (!data) {
                    that.$message.warning('文件下载失败')
                    return
                }
                let url = window.URL.createObjectURL(new Blob([data]), { type: blobType.type[blobType.suffix.indexOf('.pdf')] })
                let link = document.createElement('a')
                link.style.display = 'none'
                link.href = url
                link.setAttribute('download', fileName)
                document.body.appendChild(link)
                link.click()
                document.body.removeChild(link) //下载完成移除元素
                window.URL.revokeObjectURL(url) //释放掉blob对象
            })
        },
    }
}
</script>
<style lang="less">
.quality-system-fwjmc{
    // display: flex;
    // align-items: center;
    .fxdzt-name{
        // display: inline-block;
        margin-left: 3px;
        color: #fff;
        padding: 0 3px;
        font-size: 14px;
        border-radius: 2px;
    }
    .orange-v{
        background: orange;
    }
    .yellow-v{
        background: yellow;
    }
    .red-v{
        background: red;
    }
}
.process-monitoring-box{
    .resource-library-type-table{
        display: flex;
        width: 100%;
        align-items: flex-start;
        background-color: #fff;
        .resource-library-type{
            // margin-top: 110px;
            width: 180px;
            height: calc(100vh - 116px);
            overflow-x: hidden;
            overflow-y: auto;
            .ant-tree li .ant-tree-node-content-wrapper{
                padding: 0 !important;
            }
            .ant-tree-title{
                // font-weight: 600;
                color: #000;
            }
            // .ant-tree li{
            //     display: flex !important;
            //     white-space:wrap !important;
            // }
        }
        .resource-library-table{
            flex: 1;
        }
    }
    .tree-vxetable-box{

    }
}
.xdzf-modal-box{
    .ant-radio-wrapper{
        font-size: 18px;
    }
    .ant-radio-inner{
        width: 18px;
        height: 18px;
    }
    .ant-radio-inner::after{
        width: 11px;
        height: 11px;
    }
}
</style>
